include<tools/util.scad>

$fn=100;

//left_down_part();
//translate([240,12,0])rotate([0,0,180])right_down_part();
//translate([-90,-40,0])up_part();
clip();

module left_down_part(){
    difference(){
        cube([12,12,122]);
        translate([1.5,1.5,97])#cube([9,9,25.1]);
    }
    posz=[0,110];
    for(i=posz){
        translate([12,0,i]){
            difference(){
                cube([100,12,12]);
                translate([85,1.5,1.5])cube([15.1,9,9]);
            }
        }
    }

}

module right_down_part(){
    difference(){
        cube([12,12,122]);
        translate([1.5,1.5,97])#cube([9,9,25.1]);
    }
    posz=[0,110];
        for(i=posz){
        translate([12,0,i]){
            union(){
                cube([100,12,12]);
                translate([100,1.7,1.7])cube([14.8,8.6,8.6]);
            }
        }
    }

}

module up_part(){
    translate([0,0,6]){
        translate([-86,0,0])rotate([0,90,0])cylinder(h=172,d=12);
        translate([86,0,0])leg_of_up_part();
        translate([-86,0,0])leg_of_up_part();
       }
}
module leg_of_up_part(){
    sphere(d=12);
    cylinder(h=45,d=12);
    translate([0,0,45])hull(){
        cylinder(h=30,d=12);
        translate([0,0,45])cube([12,12,30],center=true);
    }
    translate([0,0,117.4])cube([8.6,8.6,24.8],center=true);
    
}

module clip(){
    difference(){
        //union(){
            translate([-8,-6,1])minkowski(){
                cube([20,12,38]);
                sphere(1);
            }
          //  translate([0,0,1])cylinder(h=38,d=15);
        //}

        translate([-5,-5.5,0])cube([32,11,41]);
        cylinder(h=40.1,d=12);
    }
}